package com.woniu.project.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.project.core.domain.ProductEntityIdentify;
import com.woniu.project.dto.identifydto.IdentifyDto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author WHF
 * @since 2020-10-13
 */
public interface ProductEntityIdentifyMapper extends BaseMapper<ProductEntityIdentify> {

    @Select("SELECT p.product_entity_identify_id,p.product_entity_degree,\n" +
            "p.product_entity_identify_comment,p.product_entity_identify_status,\n" +
            "p.product_entity_identify_time,m.management_name from\n" +
            " pawn_product_entity_identify p left join pawn_management m\n" +
            "on p.identify_man_id=m.management_id where p.product_entity_id=#{productEntityId}")
    IPage<IdentifyDto> selectIdentityList(Page<IdentifyDto> page,@Param("productEntityId") Integer productEntityId);

    @Delete("delete from pawn_product_entity_identify where product_entity_id=#{productEntityId}")
    void deleteIdentity(Integer productEntityId);
}
